package com.snopy.designPattern.create.simpleFactory;

import com.snopy.designPattern.create.abstractFactory.AbstractFactory;
import com.snopy.designPattern.create.abstractFactory.FactoryProducer;
import lombok.extern.slf4j.Slf4j;

/**
 * @author snopy
 * @version 1.0.0
 * @classname SimpleFactoryDemo
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/01 12:28
 */
@Slf4j
public class SimpleFactoryDemo {
    public static void main(String[] args) {
        Car suv = null;
        Ship ship = null;
        AbstractFactory factory = FactoryProducer.getFactory("Car");
        log.info("建造suv");
        suv = factory.getCar("suv");
        suv.build();
        log.info("建造jeep");
        suv = factory.getCar("jeep");
        suv.build();
        log.info("建造bus");
        suv = factory.getCar("bus");
        suv.build();
        factory = FactoryProducer.getFactory("ship");
        log.info("打造Dugout");
        ship = factory.getShip("dugout");
        ship.build();
        factory = FactoryProducer.getFactory("human");


    }
}
